package com.zqh.myfmmall.clients;

import com.zqh.myfmmall.fallback.ProductQueryClientFallback;
import com.zqh.myfmmall.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-02-22 21:12
 */
@FeignClient(value = "product-query",fallbackFactory = ProductQueryClientFallback.class)
public interface ProductQueryClient{
    @PostMapping("product/getByIds")
    Result getByIds(@RequestBody List<String> ids);

    @GetMapping("product/retrieve/{id}")
    Result getById(@PathVariable("id") String id);

    @GetMapping("product/rootCategoryHighestSelling/{rootCategoryId}")
    Result rootCategoryHighestSelling(@PathVariable("rootCategoryId") String rootCategoryId);

    @GetMapping("product/retrieveHighestSellingVo/{categoryId}")
    Result retrieveHighestSellingVo(@PathVariable("categoryId") String categoryId);

    @GetMapping("product/retrieveLatestVo/{categoryId}")
    Result retrieveLatest(@PathVariable("categoryId") String categoryId);
}
